<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script type="text/javascript" src="../res/js/jquery-3.3.1.js" ></script>
	<script>
		$(function(){
			$("#save").off().on("click",function(){
				var username=$("#names").val();
				 var reg = /^1[0-9]{10}$/;
            if (!reg.test(username)) {
               
              alert("不是手机号");
            }else{
            	alert("是手机号");
            }
			})
			
		})
		
	</script>
	</head>
	
	<body>
	<input type="text" id="names" />
	<input type="button" id="save" value="验证" />
	</body>
</html>
